<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="12">
        <el-form ref="form" :model="form" label-width="120px">
          <el-form-item label="元素库类型">
            <el-radio-group v-model="form.type">
              <el-radio label="1">课程元素库</el-radio>
              <el-radio label="2">专业元素库</el-radio>
              <el-radio label="3">兵种元素库</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="选择单位">
            <UnitSelect @e-unitData="setUnitId" />
          </el-form-item>
          <el-form-item label="发布状态">
            <el-radio-group v-model="form.auditStatus">
              <el-radio label="2">已上线</el-radio>
              <el-radio label="">全部</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item>
            <el-button type="custom" @click="handleExport">导 出</el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {
    UnitSelect: () => import("@/components/unitSelect"),
  },
  data() {
    return {
      form: {
        type: "1",
        sourceUnit: "",
        auditStatus: "2",
      },
    };
  },
  mounted() {},
  methods: {
    setUnitId(v) {
      this.form.sourceUnit = v || "";
    },
    handleExport() {
      let exportPort =
        "/sysCourse/openApi/excelFormatReview?courseType=" +
        this.form.type +
        "&auditStatus=" +
        this.form.auditStatus +
        "&sourceUnit=" +
        this.form.sourceUnit;
      window.location.href = this.baseURL + exportPort;
    },
  },
};
</script>
<style scoped lang="scss">
</style>